<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #d1{width: 300px;height: 100px;
            border: 1px red dashed; }
        #d2{
            width: 280px;height: 60px;border: 1px red dashed;
            padding-left: 20px;padding-top: 40px;
         }
        #d3{
            width: 220px;height: 20px;border: 1px red dashed;
            padding: 40px;
         }   
         
        #d4{
            width: 260px;height: 100px;border: 1px red dashed;
            padding-left: 40px;
        }
    </style>
</head>
<body>
    <div id="d1">小明</div>
    <div id="d2">小红</div>
    <div id="d3">小刚</div>
    <div id="d4">小杰</div>
</body>
</html>